package com.zzx.project.service.impl;

import com.zzx.project.dao.UserDao;
import com.zzx.project.entity.User;
import com.zzx.project.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService { //用户Service实现类

    @Autowired
    UserDao userDao;

    @Override
    public int addUser(User user) {
        return userDao.addUser(user);
    }

    @Override
    public void addLoginCount(int uid) {
        userDao.addLoginCount(uid);
    }

    @Override
    public int checkUname(String userName, int userId) {
        return userDao.checkUname(userName, userId);
    }

    @Override
    public int checkUemail(String userEmail, int userId) {
        return userDao.checkUemail(userEmail, userId);
    }

    @Override
    public int checkUphone(String userPhone, int userId) {
        return userDao.checkUphone(userPhone, userId);
    }

    @Override
    public int fixPass(int uid, String newPass) {
        return userDao.fixPass(uid, newPass);
    }

    @Override
    public int getOpNum() {
        return userDao.getOpNum();
    }

    @Override
    public User getUserById(int uid) {
        return userDao.getUserById(uid);
    }

    @Override
    public User getUserByName(String uname) {
        return userDao.getUserByName(uname);
    }

    @Override
    public int getNewUserId() {
        return userDao.getNewUserId();
    }

    @Override
    public List<User> getAll() {
        return userDao.getAll();
    }

    @Override
    public User login(String userInfo, String loginType) {
        return userDao.login(userInfo, loginType);
    }

    @Override
    public int uploadImgById(User user) {
        return userDao.uploadImgById(user);
    }

    @Override
    public int updateInfo(User user) {
        return userDao.updateInfo(user);
    }
}
